﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="wTintuc_slider.ascx.cs" Inherits="eDream.admin.wTintuc_slider" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxUploadControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>


<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxClasses" TagPrefix="dx" %>

<script type="text/javascript">
    // <![CDATA[
    function Uploader_OnUploadStart() {
        btnUpload.SetEnabled(false);
    }

    function Uploader_OnFileUploadComplete(args) {
        var imgSrc = aspxPreviewImgSrc;
        if (args.isValid) {
            var date = new Date();
            imgSrc = '<%=pathUrl %>' + args.callbackData;
            //alert(imgSrc);
        }
        getPreviewImageElement().src = imgSrc;
    }
    function Uploader_OnFilesUploadComplete(args) {
        UpdateUploadButton();
    }
    function UpdateUploadButton() {
        btnUpload.SetEnabled(uploader.GetText(0) != "");
    }
    function getPreviewImageElement() {
        return document.getElementById("previewImage");
    }
</script>

<div style="margin-top: 20px">
    <asp:HiddenField ID="hdfID" runat="server" />
    <div class="contentext1">
        Tiêu đề
    </div>
    <div class="contentext2">
        <dx:ASPxTextBox ID="txtTieude" runat="server" Width="200px" Theme="DevEx"></dx:ASPxTextBox>
    </div>

    <div class="Clear"></div>
    <div class="contentext1">
        Link
    </div>
    <div class="contentext2">
        <dx:ASPxTextBox ID="txtlink" runat="server" Width="200px" Theme="DevEx"></dx:ASPxTextBox>
    </div>

    <div class="Clear"></div>
    <div class="contentext1">
        Ảnh
    </div>
    <div class="contentext2">
        <dx:ASPxUploadControl ID="uplImage" runat="server" ClientInstanceName="uploader" ShowProgressPanel="True"
            NullText="Click here to browse files..." Size="35" OnFileUploadComplete="uplImage_FileUploadComplete">
            <ClientSideEvents FileUploadComplete="function(s, e) { Uploader_OnFileUploadComplete(e); }"
                FilesUploadComplete="function(s, e) { Uploader_OnFilesUploadComplete(e); }"
                FileUploadStart="function(s, e) { Uploader_OnUploadStart(); }"
                TextChanged="function(s, e) { UpdateUploadButton(); }"></ClientSideEvents>
            <ValidationSettings MaxFileSize="4194304" AllowedFileExtensions=".jpg,.jpeg,.jpe,.gif">
            </ValidationSettings>
        </dx:ASPxUploadControl>

        <br />
        <dx:ASPxLabel ID="lblAllowebMimeType" runat="server" Text="Allowed image types: jpeg, gif"
            Font-Size="8pt">
        </dx:ASPxLabel>
        <br />
        <dx:ASPxLabel ID="lblMaxFileSize" runat="server" Text="Maximum file size: 4Mb" Font-Size="8pt">
        </dx:ASPxLabel>
        <br />
        <dx:ASPxButton ID="btnUpload" runat="server" AutoPostBack="False" Text="Upload" ClientInstanceName="btnUpload"
            Width="100px" ClientEnabled="False">
            <ClientSideEvents Click="function(s, e) { uploader.Upload(); }" />
        </dx:ASPxButton>
        <br />
        <img src="../Image/icon/26_mail.png" id="previewImage" alt="" />
    </div>

    <div class="Clear"></div>
    <div class="contentext2">
        <dx:ASPxLabel ID="lbthongbao" runat="server" Text=" "></dx:ASPxLabel>
        <br />
        <dx:ASPxButton ID="btnOk" runat="server" Text="Cập nhật" Theme="iOS" OnClick="btnOk_Click"></dx:ASPxButton>
    </div>
    <div class="Clear"></div>
</div>
